<!--
 * @description  : 建议推送列表
 * @descriptionDetail: 建议推送列表
 * @copyright    : 浙江烟草
 * @author       : mwq
 * @create       : 2022-09-27 09:58:58
-->
<template>
  <view>
    <!-- #ifdef H5-ONLY -->
    <theme-navbar
      :is-white="false"
      title="查投建议书"
      :custom-back="goback"
      style="z-index: 99999"
    > 
    </theme-navbar>
    <!-- #endif -->
    <view>
      <view class="hander">
        <u-row gutter="12" style="margin:10px">
          <u-col style="font-size:24px;font-weight:bold;margin-left:5px;" span="12">
            {{ doc.compName }}
          </u-col>
        </u-row>
        <u-line class="u-line" color="#999" margin="20rpx"></u-line>
        <u-row gutter="12" style="margin:10px">
          <u-col style="color:#999;margin-bottom:8px;" span="8">
            评价期
          </u-col>
          <u-col style="color:#999;margin-bottom:8px;" span="4">
            内管推送时间
          </u-col>
          <u-col style="font-size:16px;margin-bottom:8px;" span="8">
            {{ doc.reportCycle||'----' }}
          </u-col>
          <u-col style="font-size:16px;margin-bottom:8px;" span="4">
            {{ doc.sendTime ||'----' }}
          </u-col>
          <u-col style="color:#999;margin-bottom:8px;" span="8">
            营销反馈时间
          </u-col>
          <u-col style="color:#999;margin-bottom:8px;" span="4">
            验证时间
          </u-col>
          <u-col style="font-size:16px;margin-bottom:6px;" span="8">
            {{ doc.feedbackTime ||'----' }}
          </u-col>
          <u-col style="font-size:16px;margin-bottom:6px;" span="4">
            {{ doc.verifyTime||'----' }}
          </u-col>
        </u-row>
      </view>
      <view>
        <u-row gutter="12" style="margin:20px 10px" @tap="searchDatas">
          <u-col span="3.3" style="font-size:16px;font-weight:600">
            <u-row gutter="12">
              <u-col span="2">
                <view style="width:5px;height:20px;border-radius:25px;background-color:#2ed573;"></view>
              </u-col>
              <u-col span="10">
                查多多投
              </u-col>
            </u-row>
          </u-col>
          <u-col span="2.5" style="font-size:16px">
            待反馈{{ doc.regularReportNum.ni1TodoCnt }}
          </u-col>
          <u-line class="u-line" color="#999" direction="col" length="40rpx"></u-line>
          <u-col span="5.5" style="font-size:16px">
            已反馈{{ doc.regularReportNum.ni1DoneCnt }}
          </u-col>
          <u-icon name="arrow-right" style="float:right" color="#blue" size="38"></u-icon>
        </u-row>
        <u-line class="u-line" color="#999" margin="5rpx"></u-line>
        <u-row gutter="12" style="margin:20px 10px" @tap="searchDatal">
          <u-col span="3.3" style="font-size:16px;font-weight:600">
            <u-row gutter="12">
              <u-col span="2">
                <view style="width:5px;height:20px;border-radius:25px;background-color:#2ed573;"></view>
              </u-col>
              <u-col span="10">
                查少少投
              </u-col>
            </u-row>
          </u-col>
          <u-col span="2.5" style="font-size:16px">
            待反馈{{ doc.regularReportNum.ni2TodoCnt }}
          </u-col>
          <u-line class="u-line" color="#999" direction="col" length="40rpx"></u-line>
          <u-col span="5.5" style="font-size:16px">
            已反馈{{ doc.regularReportNum.ni2DoneCnt }}
          </u-col>
          <u-icon name="arrow-right" style="float:right" color="#blue" size="38"></u-icon>
        </u-row>
        <u-line class="u-line" color="#999" margin="5rpx"></u-line>
        <u-row gutter="12" style="margin:20px 10px" @tap="searchDataF">
          <u-col span="3.3" style="font-size:16px;font-weight:600">
            <u-row gutter="12">
              <u-col span="2">
                <view style="width:5px;height:20px;border-radius:25px;background-color:#2ed573;"></view>
              </u-col>
              <u-col span="10">
                流多少投
              </u-col>
            </u-row>
          </u-col>
          <u-col span="2.5" style="font-size:16px">
            待反馈{{ doc.regularReportNum.no1TodoCnt }}
          </u-col>
          <u-line class="u-line" color="#999" direction="col" length="40rpx"></u-line>
          <u-col span="5.5" style="font-size:16px">
            已反馈{{ doc.regularReportNum.no1DoneCnt }}
          </u-col>
          <u-icon name="arrow-right" style="float:right" color="#blue" size="38"></u-icon>
        </u-row>
        <u-line class="u-line" color="#999" margin="5rpx"></u-line>
        <u-row gutter="12" style="margin:20px 10px" @tap="searchDataD">
          <u-col span="3.3" style="font-size:16px;font-weight:600">
            <u-row gutter="12">
              <u-col span="2">
                <view style="width:5px;height:20px;border-radius:25px;background-color:#2ed573;"></view>
              </u-col>
              <u-col span="10">
                差大少投
              </u-col>
            </u-row>
          </u-col>
          <u-col span="2.5" style="font-size:16px">
            待反馈{{ doc.regularReportNum.no2TodoCnt }}
          </u-col>
          <u-line class="u-line" color="#999" direction="col" length="40rpx"></u-line>
          <u-col span="5.5" style="font-size:16px">
            已反馈{{ doc.regularReportNum.no2DoneCnt }}
          </u-col>
          <u-icon name="arrow-right" style="float:right" color="#blue" size="38"></u-icon>
        </u-row>
        <u-line class="u-line" color="#999" margin="5rpx"></u-line>
        <u-row gutter="12" style="margin:20px 10px" @tap="outLineRemind">
          <u-col span="6" style="font-size:16px;font-weight:600">
            <u-row gutter="12">
              <u-col span="1">
                <view style="width:5px;height:20px;border-radius:25px;background-color:red;"></view>
              </u-col>
              <u-col span="7">
                外流线路提醒
              </u-col>
              <u-col span="4">
                <view style="width:25px;height:20px;border-radius:25px;background-color:red;color:white;text-align:center">
                  {{ doc.regularReportNum.lineCnt }}
                </view>
              </u-col>
            </u-row>
          </u-col>
          <u-col span="5.3" style="font-size:16px">
          </u-col>
          <u-icon name="arrow-right" style="float:right" color="#blue" size="38"></u-icon>
        </u-row>
        <u-line class="u-line" color="#999" margin="5rpx"></u-line>
        <u-row gutter="12" style="margin:20px 10px" @tap="outCustomerRemind">
          <u-col span="6" style="font-size:16px;font-weight:600">
            <u-row gutter="12">
              <u-col span="1">
                <view style="width:5px;height:20px;border-radius:25px;background-color:red;"></view>
              </u-col>
              <u-col span="8">
                外流零售户提醒
              </u-col>
              <u-col span="3">
                <view style="width:25px;height:20px;border-radius:25px;background-color:red;color:white;text-align:center">
                  {{ doc.regularReportNum.licCnt }}
                </view>
              </u-col>
            </u-row>
          </u-col>
          <u-col span="5.3" style="font-size:16px">          
          </u-col>
          <u-icon name="arrow-right" style="float:right" color="#blue" size="38"></u-icon>
        </u-row>
        <u-line class="u-line" color="#999" margin="5rpx"></u-line>
      </view>
    </view>
    <u-button type="primary" class="button" @tap="verify">
      提交
    </u-button>
  </view>
</template>

<script>
import approval from "@/service/internal/approval.service.js";
import util from "@/common/util.js";
export default {
  data(){
    return{
      doc:{},
    }
  },
  created(){
    this.init();
  },
  onLoad(opt) {
    this.doc =  JSON.parse(opt.docStr);
  },
  methods:{
    verify(){
      approval.regularReportCanVerify(this.doc.regularReportUuid).then((res) => {
        if(res.success && res.bean){
          this.handelSearch();
        }else{
          this.$u.toast('请检查是否有未反馈的推送建议');
        }
      });
    },
    handelSearch(){
      let toDay = util.dateUtils.dateFormat('yyyy年MM月dd日',new Date())
      let params = {
        gfaCode:'01',
        nextPersons:"",
        approvePersonUuid:this.$storage.get(this.$rp.common.USER).user.personUuid,
      }
      params.approveInfo = "已反馈"
      params.approveDate = toDay
      approval.regularReportAgree({...this.doc,},params).then((res) => {
        if(res.success){
          this.$u.toast('提交成功');
          this.goback();
        }else{
          this.$u.toast('提交失败');
        }
      });
    },
    init(){
      approval.regularReportGetDoc();
    },
    searchDatas(){
      this.$u.route({
        url:'pages/internal/docFrame/components/regularDatas',
        params:{managerSuggestionCode:'I1 ',regularReportUuid:this.doc.regularReportUuid,title:'查多多投',},
      });
    },
    searchDatal(){
      this.$u.route({
        url:'pages/internal/docFrame/components/regularDatas',
        params:{managerSuggestionCode:'I2 ',regularReportUuid:this.doc.regularReportUuid,title:'查少少投',},
      });
    },
    searchDataF(){
      this.$u.route({
        url:'pages/internal/docFrame/components/regularDatas',
        params:{managerSuggestionCode:'O1 ',regularReportUuid:this.doc.regularReportUuid,title:'流多少投',},
      });
    },
    searchDataD(){
      this.$u.route({
        url:'pages/internal/docFrame/components/regularDatas',
        params:{managerSuggestionCode:'O2 ',regularReportUuid:this.doc.regularReportUuid,title:'差大少投',},
      });
    },
    outLineRemind(){
      this.$u.route({
        url:'pages/internal/docFrame/components/outLineRemind',
        params:{regularReportUuid:this.doc.regularReportUuid,targetLevel:'08',},
      });
    },
    outCustomerRemind(){
      this.$u.route({
        url:'pages/internal/docFrame/components/outCustomerRemind',
        params:{regularReportUuid:this.doc.regularReportUuid,targetLevel:'99',},
      });
    },
    // goback(){
    //   this.$u.route("pages/internal/approval/index"); // 退回审批列表
    // },
  },
}
</script>

<style lang="scss" scoped>
.page {
  background-color: #F6F6F6;
  height: 100%;
  width: 100%;
}
.button{
  position: fixed;
  bottom: 3px;
  width:100%;
  margin:0px,5px,
}
.hander{
  margin-bottom: 60PX;
}
</style>